﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace YAPSAR.Forms
{
    public class AbstractForm : Form
    {
        public AbstractForm()
        {
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            SetStyle(ControlStyles.SupportsTransparentBackColor, true);
        }

        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            // Set the transparency key here, so that we override any choice by an inheriting form.
            this.TransparencyKey = Color.Magenta;
        }

        protected override void WndProc(ref Message m)
        {
            base.WndProc(ref m);
        }

        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);

            var paintRectangle = this.ClientRectangle;
            paintRectangle.Inflate(-1, -1);

            e.Graphics.DrawRectangle(Pens.Blue, paintRectangle);
        }
    }
}
